import request from '../utils/request.js'
import store from '../store/index.js'
export function getCoordinateByAddress(address) {
  return request({
    url: '/activity/address/',
    method: 'get',
    params: {
      'address': address
    }
  })
}

export function createActivity(act) {
  return request({
    url: 'activity/add/',
    method: 'post',
    data: act
  })
}

export function getActivityByUser() {
  return request({
    url: 'activity/user/' + store.getters.userId,
    method: 'get'
  })
}

export function getAllActivitybyActPartId() {
  return request({
    url: 'activity/part/' + store.getters.userPartId,
    method: 'get'
  })
}

export function getAllActivity() {
  return request({
    url: '/activity/all',
    method: 'get'
  })
}

export function getActivityByActStatus() {
  return request({
    url: '/activity/status/' + '0',
    method: 'get'
  })
}

export function getActivityByActId(actId) {
  return request({
    url: '/activity/id/' + actId,
    method: 'get'

  })
}

export function auditActivityByActId(actId) {
  return request({
    url: '/activity/verify/' + actId,
    method: 'put'
  })
}

export function conditionSearchActivity(condition) {
  return request({
    url: '/activity/condition',
    method: 'get',
    params: condition
  })
}
